function selectAll(key, pianoKeys) {
    const noteIndex = {
        'C': 0, 'C#': 1, 'Db': 1, 'D': 2, 'D#': 3, 'Eb': 3, 'E': 4, 'F': 5, 'F#': 6, 'Gb': 6, 'G': 7, 'G#': 8, 'Ab': 8, 'A': 9, 'A#': 10, 'Bb': 10, 'B': 11
    };
    
    const rootIndex = (noteIndex[key] + pianoKeys.indexOf('C4')) % pianoKeys.length;
    if (rootIndex === -1) {
        console.log('Invalid root note');
        return;
    }

    const chordNotes = {};
    for (const chord in chords) {
        const intervals = chords[chord];
        const notes = [];
        let index = rootIndex;

        // Assuming intervals are note offsets and not actual note names
        for (let i = 0; i < intervals.length; i++) {
            notes.push(pianoKeys[(index + intervals[i]) % pianoKeys.length]);
        }

        chordNotes[chord] = notes;
    }

    return chordNotes;
}

